<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/6/1
  Time: 18:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/common.jsp" %>
<html>
<head>
    <title>Title</title>
    <script>
        $(function () {
            $('#myFile').fileinput({
                language: 'zh',
                uploadUrl: "<%=path%>/file/upLoadFile",
                browseClass: 'btn btn-success',
                maxFileCount: 3,
                enctype: "multipart/form-data",
                maxFileSize: 999999, // 单位kb
                allowedFileExtensions: ['jpg', 'png', 'gif'],
            });

            // ajax上传成功之后调用该事件
            $('#myFile').on("fileuploaded", function (event, data, previewId, index) {
                if (data.response != null) {
                    var count = $("[name=bigpic]").val();1 2 3
                    count+=data.response.imgUrl+"," 1,2 ,3
                    $("[name=bigpic]").val(count);
                }

            })
        })
    </script>
</head>
<body>
<form id="img_update">
    <div class="container-fluid">
        <div class="panel panel-primary" style="width:400px">
            <div class="panel-heading">
                <h1>图片上传</h1>
            </div>
            <div class="form-group">
                <label for="myFile">头像</label>
                <input type="hidden" value="${rid}" name="rid">
                <input type="file" class="form-control" name="myFile" id="myFile" multiple>
            </div>
            <input type="text" name="bigpic" id="img_url">
        </div>
    </div>
    </div><br>
</form>

</body>
</html>
